<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>保洁服务</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/cleanPackage.css">

    <script src="js/jquery/3.2.1/jquery.min.js"></script>
    <!-- 插件js -->
	<script src="../js/zepto.js"></script>
	<script src="../js/sm.js" ></script>
	<script src="../js/sm-extend.js" ></script>
	<script src="../js/request.js"></script>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
	<script src="../../js/common.js"></script>
	<script src="../../jsp/js/pointlog.js"></script>
	<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>  
  </head>
  <script type="text/javascript">
	window.$$=window.Zepto = Zepto;
	 var phone="";
	 var nonce="";//生成签名的随机串
     var signature="";//签名
     var timestamp="";//时间戳
     var title="蓝居管家--日常保洁";
     var desc="蓝居管家提供专业化、标准化的保洁服务";
     var sharLink="http://lanjushiye.com.cn/LanJuPublic/jsp/service/servicePackage.html?serviceType=1";
     var imgUrl="http://lanjushiye.com.cn/LanJuPublic/images/lanju.jpg";
     function loadWx(){
   	  wx.config({
   		    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
   		    appId: 'wxb3b7beee9190b2ef', // 必填，公众号的唯一标识wxd894029b9bdb4b67
   		    timestamp: timestamp, // 必填，生成签名的时间戳
   		    nonceStr: nonce, // 必填，生成签名的随机串
   		    signature: signature,// 必填，签名
   		    jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ'] // 必填，需要使用的JS接口列表
   		});
   	  wx.ready(function(){
   		  //分享到朋友圈
   		  wx.onMenuShareTimeline({
   			    title: title, // 分享标题
   			    link: sharLink, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
   			    imgUrl: imgUrl, // 分享图标
   			    desc: desc, // 分享描述
   			    success: function () {
   			    // 用户确认分享后执行的回调函数
   				},
   			cancel: function () {
   			    // 用户取消分享后执行的回调函数
   		    }
   		});
   		  //分享到朋友
   		  wx.onMenuShareAppMessage({
   			  title: title, // 分享标题
   			  desc: desc, // 分享描述
   			  link: sharLink, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
   			  imgUrl: imgUrl, // 分享图标
   			  type: 'link', // 分享类型,music、video或link，不填默认为link
   			  dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
   			  success: function () {
   			  // 用户确认分享后执行的回调函数
   			  },
   			  cancel: function () {
   			  // 用户取消分享后执行的回调函数
   			  }
   			  });
   		  //分享到QQ
   		  wx.onMenuShareQQ({
   			  title: title, // 分享标题
   			  desc: desc, // 分享描述
   			  link: sharLink, // 分享链接
   			  imgUrl: imgUrl, // 分享图标
   			  success: function () {
   			  // 用户确认分享后执行的回调函数
   			  },
   			  cancel: function () {
   			  // 用户取消分享后执行的回调函数
   			  }
   			  });
   	  });
   	  
   	  wx.error(function(res){
   		
   	  });
   	  
   }
     
     var args=ponitLog.getWindowsParam();
     console.log(args);
</script>
  <body>
  <nav class="bar bar-tab">
    <a class="tab-item "  onclick="toLink('home.html',this)">
      <span class="icon icon-home"></span>
      <span class="tab-label">首页</span>
    </a>
    <a class="tab-item"  onclick="toLink('lanjuZhengzu.html?type=2',this)"  >
      <span class="icon icon-card"></span>
      <span class="tab-label">租房</span>
    </a>
    <a class="tab-item active"  onclick="toLink('service/servicePackage.html?serviceType=1',this)">
      <span class="icon icon-menu"></span>
      <span class="tab-label">服务</span>
    </a>
    <a class="tab-item" onclick="toLink('zukeKongjian.html',this)">
      <span class="icon icon-friends"></span>
      <span class="tab-label">我的</span>
    </a>
  </nav>
    <div class="page">
      <header class="bar bar-nav">
<!--         <a class="button button-link button-nav pull-left" href="javascript:window.history.back();" data-transition='slide-out'> -->
<!--           <span class="icon icon-left"></span> -->
<!--           返回 -->
<!--         </a> -->
        <h1 class="title">保洁服务</h1>
      </header>
 
      <!-- 主体内容 -->
      <div class="D_content">
        <div class="D_banner">
          <img src="../../images/service_ban.jpg" alt="" />
        </div>
        <div class="D_content--wrap">
          <!-- 保洁套餐 -->
          <div class="clean_package--list">
            <h2 class="D_content--title serviceList">保洁服务</h2>
          </div>

          <p class="D_wait--more">更多服务敬请期待~</p>
        </div>
      </div>
      <div style="bottom:4rem;right:0px;position: fixed;width: 15%;z-index: 99;" onclick="toSharehtml();">
      	<img alt="" src="../../images/share_btn.jpg" >
      </div>
    </div>
    <script type="text/javascript">
    var path = "/LanJuPublic";
    var serviceType = Request.queryString("serviceType");
	$(function(){
	   	  var url = encodeURI(location.href.split('#')[0]);
	   	  $.ajax({
	   	         url: "../../weixinImpl/getEncryptJsapiTicket.spring?rn="+(new Date().getTime()),
	   	         type: "POST",
	   	         data:{"url":url},
	   	         dataType: "json",
	   	         success: function(data){
	   	        	 if(data != null){
	   	        		 nonce=data.nonce;
	   		             signature=data.signature;
	   		             timestamp=data.timestamp;
	   		             loadWx();
	   	        	 }
	   	             
	   	          },
	   	          error:function(err){
	   	            console.log('异常');
	   	          }
	   	        });
		loadList();
	})
	function toSharehtml(){
		document.location.href = "../newUserCoupon.html?phone="+getCookie("phone");
	}
	function getCookie(name) 
	{ 
	    var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
	 
	    if(arr=document.cookie.match(reg))
	 
	        return unescape(arr[2]); 
	    else 
	        return null; 
	} 
	function loadList(){
	$$.showPreloader("加载中");
	$.ajax({
		url : path+"/service/queryServiceList.do",
		data : {
			pageSize: 10,
			pageNumber: 1,
			serviceType:serviceType
		},
		type : "post",
		dataType : 'json',
		cache : false,
		success : function(ret){
			$$.hidePreloader();
			var html = '';
			if(ret.rows && ret.rows.length>0){
				console.log(ret);
				$.each(ret.rows,function(i,n){
					console.log(n);
					html += '<ul><li><a  onclick="toDetailLink(\''+n.serviceId+'\')" style=\"min-height: 118px;\">'+
                  	'<p class="pack--img fl">'+
                   '<img src="'+n.imgUrl+'" alt="" />'+ 
//                      '<img src="'+path+'/jsp/service/images'+n.imgUrl+'" alt="" />'+  
                   //'<img src="'+n.imgUrl+'" alt="" />'+ 
                  '</p>'+
                  '<div class="pave--detail fr">'+
                    '<p class="p1">'+n.serviceName+'<p class="p1" style=\"font-size:22px;color:red\">'+(n.serviceCount*n.price)+'元</p></p>'+
                    '<p class="p2 esp2">'+n.serviceDesc+'</p>'+
                    '<span class="konw_more">了解详情></span>'+
                  '</div>'+
               ' </a></li></ul>';
				});
				$(".serviceList").after( html)
			}else{
				$(".serviceList").after('<ul><li >暂无数据</li></ul>' );
			}
			
		},
		error: function(){
			$$.hidePreloader();
			$$.toast("加载出错");
		}
	});
}
	function toDetailLink(id) {
		window.location.href="../service/serviceDetail.html?serviceId="+id;
	}
	
	function toLink(txt,tagrt) {
		document.location.href = "../" + txt;
	}
	
</script>
  </body>
</html>